package com.qf.smsplatform.pojo;


import org.springframework.util.ObjectUtils;

public class TNotify implements CheckNull{

  private Long id;
  private String tag;
  private String desp;
  private Long notifyState;
  private Long cacheState;


  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }


  public String getTag() {
    return tag;
  }

  public void setTag(String tag) {
    this.tag = tag;
  }


  public String getDesp() {
    return desp;
  }

  public void setDesp(String desp) {
    this.desp = desp;
  }


  public Long getNotifyState() {
    return notifyState;
  }

  public void setNotifyState(Long notifyState) {
    this.notifyState = notifyState;
  }


  public Long getCacheState() {
    return cacheState;
  }

  public void setCacheState(Long cacheState) {
    this.cacheState = cacheState;
  }

  @Override
  public String toString() {
    return "TNotify{" +
            "id=" + id +
            ", tag='" + tag + '\'' +
            ", desp='" + desp + '\'' +
            ", notifyState=" + notifyState +
            ", cacheState=" + cacheState +
            '}';
  }

  @Override
  public boolean isNull(CheckType type) {
    switch (type){
      case DELETE:
        return getTag().isEmpty();
      case UPDATE:
        return ObjectUtils.isEmpty(getCacheState())||ObjectUtils.isEmpty(getTag())||ObjectUtils.isEmpty(getDesp())||ObjectUtils.isEmpty(getNotifyState());
        case ADD:
    }
    return false;
  }
}
